<include file="header" />
<body>
<div class="wraper ipad">
	<div class="top">
		<p>订单详情</p>
	</div>
	<div class="order-lists lists">
		<div class="lists tb-mode">
			<a href="#" class="tb-cell list-left">菜单详情（<span class="num">{BEESCRM:$count}</span>个菜）</a>
		</div>
		<volist name="goodsList" id="vo">
			<div class="lists tb-mode foods">
				<a href="#" class="tb-cell list-left">
					<div class="img-box"><img src="{BEESCRM:$vo.goods_logo}"></div>
				</a>
				<a href="#" class="tb-cell list-center">
					<p>{BEESCRM:$vo.goods_name}</p>
					<p class="prize">{BEESCRM:$vo.goods_price}元</p>
				</a>
				<div class="tb-cell list-right">
					<div class="tb-mode amount" style="text-align: center;border:0;">
						{BEESCRM:$vo.goods_num}
					</div>
				</div>
			</div>
		</volist>
		<div class="lists tb-mode bottom-none">
			<div class="tb-cell list-right">总价：<span class="num">{BEESCRM:$order.order_amount}元</span></div>
		</div>
	</div>

	<div class="order-lists lists">
		<div class="lists order-mes bottom-none">
			<p><span class="field">地址：</span>{BEESCRM:$order.restaurant_name}</p>
			<p><span class="field">下单时间：</span>{BEESCRM:$order.create_time|date="Y-m-d H:i",###}</p>
			<p><span class="field">就餐时间：</span>{BEESCRM:$order.take_time}</p>
			<p><span class="field">付款方式：</span>微信支付</p>
			<p><span class="field">订单编号：</span>{BEESCRM:$order.order_sn}</p>
			<p><span class="field">备注：</span>{BEESCRM:$order.memo}</p>
		</div>
	</div>
	<input type="hidden" value="{BEESCRM:$order.order_id}" id="id"/>
	<div class="btn-box">
		<if condition="$order.status eq 1">
			<a href="#" class="btn send">领取</a>
			<else/>
			<a href="#" class="btn btn-gray">已领取</a>
		</if>
	</div>

</div>

<include file="commonJS" />
</body>
</html>
<script>
	$(function(){
		$(document).on('click','.send',function(){
			var id = $('#id').val();
			$.confirm('确认发货吗？', drop);
			function drop() {
				$.ajax({
					'url': "/interface/IrsApi/send",
					'data': {id:id},
					'dataType':'json',
					'type': 'POST',
					'async': false,
					success: function(data) {
						if (data.status == 'S') {
							fm.alert(data.message);
							reload();
						}else{
							fm.alert(data.message);
							return false;
						}
					}
				});
			}
		});
	});

	//页面刷新
	function reload(){
		setTimeout('location.reload()',1000);
	}
</script>
